export function useDicts() {
    const businessTypeOption = [
        {
            label: '其他',
            value: '0',
        },
        {
            label: '新增',
            value: '1',
        },
        {
            label: '修改',
            value: '2',
        },
        {
            label: '删除',
            value: '3',
        },
        {
            label: '授权',
            value: '4',
        },
        {
            label: '导出',
            value: '5',
        },
        {
            label: '导入',
            value: '6',
        },
        {
            label: '强退',
            value: '7',
        },
        {
            label: '生成代码',
            value: '8',
        },
        {
            label: '清空数据',
            value: '9',
        },
    ]
    const statusOption = [
        {
            label: '正常',
            value: '0',
        },
        {
            label: '异常',
            value: '1',
        },
    ]
    const loginStatusOption = [
        {
            label: '成功',
            value: '0',
        },
        {
            label: '失败',
            value: '1',
        },
    ]
    const dicts = {
        businessTypeOption,
        loginStatusOption,
        statusOption,
    }
    const getDictLabel = (mapKey: string, dicKey: number | string) => {
        if (mapKey in dicts) {
            return dicts[mapKey].find(item => item.value == dicKey)?.label
        }
        else {
            return ''
        }
    }
    return { dicts, getDictLabel }
}
